Embedding Banners
The Nudge SDK allows seamless integration of dynamic banners into your React Native application, enabling personalized and interactive user engagement.
Importing the Package
Ensure that NudgeWidget
is imported in your Dart file:
import { NudgeWidget } from "nudge_react_native_v2";
Embedding a Nudge Banner
To embed a banner within your React Native UI, use the NudgeWidget
widget. This widget dynamically renders the banner based on the specified widget ID.
Usage Example:
<NudgeWidget
style={{}}
label="your_globally_unique_identifier"
pageName="page_name"
/>
Parameters:
style
(Object) - Your custom stylesheetlabel
(String) - Unique identifier for the story component, as defined in the Nudge dashboard.pageName
(String) - Page name where this view is added.
Integration Notes:
- Ensure that the widget ID matches the one defined in your Nudge campaign.
- Place
NudgeWidget
within an appropriate widget tree to ensure visibility. - The banner content is dynamically fetched and updated based on campaign settings.